var payConfirmPwdCtrl;

$(function(){
	$("#payConfirmSubmitId").removeAttr("disabled");
	
	if($("#needPaypwd").val()=="y"){
		payConfirmPwdCtrl=new PwdControl("payPassword","payConfirmPwdDiv",222,28);
	}
	$("#dialogSubmitBank").dialog({
		autoOpen: false,
		modal: true,
		resizable: false,
		bgiframe: true,
		title: '提示信息',
		width:755
	});
	
});

var payConfirmSubmit = function(){
	$.ajax({
		type:"GET",
		url: ctx+"/getPayPwdUUID.shtml",
		data:{ts:new Date().getTime(),count:1,safe:1},
		async:false,
		dataType:"json",
		success:function(r){
			if(r&&r.code1){
				payConfirmPwdCtrl.encrypt(r.code1,1);
			}else{
				alert("获取支付密码随机码失败");
			}
		}
	});
	
	if($("#payPassword").val()==""){
		alert("支付密码获取失败");
		return false;
	}
	
	$("#dialogSubmitBank").dialog("open");
	$("#payConfirmForm").submit();
	$("#payConfirmSubmitTr").hide();
	$("#payConfirmSubmitId").attr("disabled","true");
};
